home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / asm / d86v401.zip / D06.DOC < prev    next >
Text File  |  1994-12-21  |  20KB  |  425 lines

  1. CHAPTER 6   MEMORY DISPLAY OPTIONS
  2.  
  3.  
  4. Memory Display Windows
  5.  
  6. The debugger allows you to set up windows into your program
  7. memory space. Using these windows, you can view memory in a
  8. variety of formats.  The windows will remain in effect until you
  9. cancel them; updating themselves automatically if the memory
  10. changes.
  11.  
  12. There are six single-line memory windows always present, in the
  13. lower right portion of the screen.  In addition, you can have the
  14. upper-right window display a 14-line page of memory values.
  15.  
  16.  
  17. Single-Line Memory Windows
  18.  
  19. A single-line memory window line consists of a specification,
  20. typed in by you, followed by a display, supplied by the debugger.
  21.  
  22. To type in a specification on any one of window lines 1 through
  23. 6, simply type the associated digit, 1 through 6, when the
  24. debugger is in its main command mode.  You can also specify the
  25. first blank window line by typing the digit 0 (providing some
  26. flexibility for keystroke scripts).  The cursor will jump to the
  27. beginning of the memory-window line you are specifying.  You then
  28. type in a display format specification, followed by the address
  29. of memory you want displayed.
  30.  
  31. The simplest form of the display format specification is a single
  32. letter, signifying one of the display types available.  The
  33. choices are:
  34.  
  35.    B       for hexadecimal bytes
  36.    W       for hexadecimal words
  37.    N       for decimal bytes
  38.    D       for decimal words
  39.    Q       for octal bytes
  40.    O       for octal words
  41.    T       for text; each byte reduced to one ASCII display character
  42.    A       for ASCII text, each byte occupying 2 display characters (the
  43.                     exact display is spelled out later in this chapter)
  44.    C       for ASCII text, occupying 2 bytes if needed, otherwise one
  45.  
  46. A format specification of one of the above letters will cause the
  47. debugger to display the array of bytes starting at the address
  48. you specify, in the format indicated by the letter, as long as
  49. there is room on the line. All letters in a format specification
  50. (or in any other context in the debugger) can be typed in either
  51. upper or lower case.
  52.                                                               6-2
  53.  
  54. The format specification should be terminated by a comma.  After
  55. the comma (and an optional space), you type the address of memory
  56. you want displayed. This consists of two values, the segment
  57. followed by the offset.  The values should be separated by a
  58. comma. You can omit the segment value if you wish: in that case,
  59. the current value of DS is used. The debugger reminds you that
  60. you have specified this option by following what you type with 2
  61. commas instead of one.
  62.  
  63. The value you type can take one of the following forms:
  64.  
  65.    a. a numeric constant, whose format is just as in the assembly
  66.       language (leading zero means default hex, otherwise default
  67.       decimal)
  68.  
  69.    b. a register name (IP is now accepted as a register name)
  70.  
  71.    c. a user symbol from the assembly language program being
  72.       debugged.
  73.  
  74. After you type the address specification, you hit the ENTER key,
  75. and the debugger fills out the rest of the line with the memory
  76. display.
  77.  
  78. For example, if you want to display hex bytes starting at 01000
  79. hex on display line 2, you type 2b,01000<ENTER>. The cursor jumps
  80. to the line immediately when you type the 2, and it displays the
  81. b,01000 on the line as you type it.  The b says you want hex
  82. bytes, and the 01000 has a leading zero to signify a hexadecimal
  83. address, not decimal.  When you press the ENTER key, the debugger
  84. displays two commas, followed by the hex bytes.  If the memory is
  85. zeroed, you will see 00 00 00 00 00 etc. to the end of the
  86. display line.
  87.  
  88.  
  89. Erasing Memory Display Lines
  90.  
  91. Any memory display window that you specify will remain in effect,
  92. always updated to show the latest memory contents, until you
  93. explicitly erase it. To erase a window, you type the number of
  94. the window, followed by a blank.  The line will also be erased if
  95. you start typing a format specification, and you hit the ENTER
  96. key before you get to your address specification.
  97.  
  98. In the coming sections, many of the examples assume (and they say
  99. so) that your display is blank before you type in the example.
  100. You can always get a blank display by typing in each number
  101. followed by a blank: "1 2 3 4 5 6 ".
  102.  
  103. If you accidentally type a digit and DON'T want to erase the line
  104. your cursor has jumped to, press the ESC key to return to the
  105. main command mode.
  106.                                                               6-3
  107.  
  108. Continuation Lines
  109.  
  110. You may continue a memory display window onto the next line, by
  111. placing a double quote mark " at the beginning of the next line.
  112. You may do this in one of two ways: you may type the number of
  113. the next line, followed by the double quote mark; or you may
  114. simply type the double quote mark at the command level.  The
  115. first method allows you to specify which window line you want
  116. continued, if there is more than one.  The second method is more
  117. convenient to use.  It places the quote mark on the last blank
  118. line that immediately follows a non-blank line.
  119.  
  120. You may continue placing " marks on as many lines as you have,
  121. creating a multi-line display.
  122.  
  123. The debugger follows the " mark with the address of memory being
  124. displayed, followed by the memory, according to the start of the
  125. type specification of the line being continued.  The memory
  126. display is aligned with the display of above line.
  127.  
  128. If you are creating a multi-line display, and your specification
  129. is a long one, you may wish to start the display at the beginning
  130. of the next line, rather than after the specification on the
  131. first line.  This will often give you more room.  You do this by
  132. terminating the format specification with a slash / instead of a
  133. comma.  For example, to display many hex bytes at the array
  134. BYTE_ARRAY, type 1b/byte_array<ENTER> followed by five double
  135. quote marks, when the memory display is empty.
  136.  
  137.  
  138. Mixed Format Specification
  139.  
  140. Instead of having all your bytes or words on a line displayed in
  141. the same format, you can mix your formats.  You do this by
  142. providing more than one letter in your format specification.  The
  143. debugger will display one memory unit for each letter-type you
  144. specify.  The line will be filled out with the last type given.
  145. For example, if you type 3nwb,01000<ENTER>, you will get a
  146. display on memory line 3 of the decimal byte at 01000, the hex
  147. word at 01001, and an array of hex bytes starting at 01003.
  148.  
  149.  
  150. Numbers in a Format Specification
  151.  
  152. You may precede any letter in a format specification with a
  153. number up to 255. The effect is the same as if you had repeated
  154. the letter the given number of times.  For example, if you type 1
  155. to go to memory line 1, followed by 4w10tb,02000<ENTER>, you will
  156. get 4 hex words at 02000, 10 text characters at 02008, and an
  157. array of hex bytes from 02012 filling out the rest of the line.
  158.                                                               6-4
  159.  
  160. You may also end your format specification with a number up to
  161. 255.  This will cause the entire specification to be repeated the
  162. given number of times. If there is room on the line for the full
  163. number given, the display will stop there-- there will be no
  164. repeating of the last type byte.  If there is not room on the
  165. line for the full number of global iterations, the debugger will
  166. stop at the end of the last iteration that would fit.  For
  167. example, the specification b8 causes 8 hex bytes to be displayed,
  168. and the remainder of the display line to be blank.  The
  169. specification b3w9 will cause the debugger to try to output 9
  170. records, each consisting of a hex byte followed by 3 hex words.
  171. After putting out 2 such records, the debugger will see that
  172. there is not room for a third full record, so it will stop.  This
  173. stopping at the record boundary allows you to continue the
  174. display, with correct alignment, on subsequent lines.
  175.  
  176.  
  177. Spacing Between Memory Display Units
  178.  
  179. In general, the debugger provides a space between each unit (byte
  180. or word) it displays.  There is an exception, however: the
  181. debugger will not space between adjacent text characters (A,C, or
  182. T specifications).
  183.  
  184. There are special specifiers G, J, and M, described in the
  185. section below, that allow you to override the debugger's spacing
  186. policies.
  187.  
  188.  
  189. Special-Action Format Specifiers
  190.  
  191. In addition to the 9 letters already mentioned that specify data
  192. types, there are 10 other letters, and 2 other characters, that
  193. cause the debugger to perform special actions.  Following is a
  194. complete description of all 21 non-digit characters that can
  195. occur within a format specification:
  196.  
  197. =  causes a display, using the format of the letter following =,
  198.    of the current memory pointer value, instead of the contents
  199.    of the memory location.  If a letter does not follow the =,
  200.    then W is used; i.e., the pointer is displayed as a 4-digit
  201.    hex word.  There are two uses for this feature that come to
  202.    mind:
  203.  
  204.    * If your address specification is symbolic, you can display
  205.      the equivalent numeric address with =w, telling you exactly
  206.      where the symbol is in memory.  Note that this display
  207.      implicitly occurs at the beginning of continuation lines. If
  208.      the format specification begins with =, then the implicit
  209.      display is suppressed, because the same address is given
  210.      explicitly by the L.
  211.  
  212.    * You can display the values of registers in a format other
  213.      than hex.  For example, in the 8086 debugger you can display
  214.      AX as a decimal number by specifying =d1,ax on one of the
  215.      memory display lines.
  216.                                                               6-5
  217.  
  218. @  causes the debugger to read the next byte it was going to
  219.    display, and instead of displaying the byte, use it as a
  220.    count, to repeat the next letter in the specification.  The
  221.    debugger uses only the bottom 7 bits of the memory byte for
  222.    the count.  For example, if the memory contains a length byte
  223.    followed by that number of text characters, the text could be
  224.    displayed by specifying @t (or @a or @c, depending on what you
  225.    want the display to look like).  If the memory contains 05 41
  226.    42 43 44 45, the @t would cause ABCDE to be displayed.
  227.  
  228. A  causes a display of a single ASCII byte, always using 2
  229.    display bytes.  Bytes in the Ctrl-key range (00--01F) display
  230.    as ^ followed by the corresponding letter; e.g. ^B for 02.  If
  231.    the top bit is on (range 080--09F), $ is used instead of ^;
  232.    e.g. $B for 082.  Displaying ASCII characters whose top bit is
  233.    on have a prepended #; e.g., #1 for 0B1.  022 is "", 023 is
  234.    "#, 024 is "$, 05E is "^, 07F is ^r (r stands for rubout), and
  235.    0FF is $r.  All other characters are their normal selves
  236.    preceded by a space.
  237.  
  238.    The A specification is used when you need guaranteed display
  239.    length for proper alignment of continuation lines; and you do
  240.    not want the potential loss of information provided by the
  241.    single-byte T specification.
  242.  
  243. B  causes a display of a single byte as a 2-digit hexadecimal
  244.    number.  Numbers less than hex 10 have a leading 0, so that
  245.    the display is always 2 digits.
  246.  
  247. C  causes a display of a single ASCII character, just as the A
  248.    specification, except that normal characters (not in the
  249.    table) display as just one byte, without the preceding space.
  250.  
  251. D  causes the display of a 16-bit word as an unsigned positive
  252.    decimal number. There will be no leading zeros in the display;
  253.    so the length of the display depends on the size of the
  254.    number.
  255.  
  256. F  causes the display of a floating point number, in one of the
  257.    three formats recognized by the 8087.  You must have a
  258.    floating point chip (8087 or 287) installed in your computer
  259.    for this to work.  You specify which of the three formats you
  260.    are reading by one of three letters immediately following the
  261.    letter F:
  262.  
  263.    FD  specifies a 4-byte Doubleword (single precision) number
  264.    FQ  specifies an 8-byte Quadword (double precision) number
  265.    FT  specifies a Ten-byte number-- 8087 extended precision.
  266.  
  267. G  causes a gap between the adjacent display formats, of one
  268.    space more than there would have been without the G.  For
  269.    adjacent string bytes, this means a space where there would
  270.    have been none.  For other data types, this means two spaces
  271.    where there would have been one.
  272.  
  273. J  (join) causes two adjacent data types, that would have had a
  274.    space between them, to have no space.
  275.                                                               6-6
  276.  
  277. L  (line) causes the display of an entire text line, using the
  278.    C-format for each character of the line.  The debugger does
  279.    not display the terminating carriage return; nor does it
  280.    display the following linefeed if there is one.  (If you want
  281.    it to, specify LUC or LUUCC instead of L.)  If a carriage
  282.    return is not found and the display line fills, then the
  283.    L-specifier is cut off in mid-string.  Any continuation line
  284.    will start up at the beginning of the format specification, at
  285.    the mid-string place in memory.
  286.  
  287. M  (mark) causes a vertical-bars symbol to be displayed.  The
  288.    symbol will replace a separating space that would have been
  289.    output in the position.  If you want the space, you can
  290.    provide G on either side (or both sides) of the M.
  291.  
  292. N  (number) causes the display of an 8-bit byte as an unsigned
  293.    positive decimal number.  There will be no leading zeroes in
  294.    the display; so the length of the display depends on the size
  295.    of the number.
  296.  
  297. O  causes a display of a 16-bit word as a 6-digit octal number.
  298.    Numbers less than octal 100000 have one or more leading
  299.    zeroes, so that the display is always 6 digits.
  300.  
  301. Q  causes a display of a single byte as a 3-digit octal number.
  302.    Numbers less than octal 100 have one or more leading zeroes,
  303.    so that the display is always 3 digits.
  304.  
  305. S  causes the display of an entire null-terminated string, using
  306.    the C-format for each character of the string.  The
  307.    terminating null (hex 00) does not generate a display (if you
  308.    want it to, specify SUC instead of S).  If a null is not found
  309.    and the display line fills, then the S-specifier is cut off in
  310.    mid-string.  Any continuation line would start up at the
  311.    beginning of the format specification, at the mid-string place
  312.    in memory.
  313.  
  314. T  causes the display of a single ASCII text byte, with a
  315.    guaranteed display space of one character.  The character
  316.    displayed is the same as the second character of the A-format.
  317.    This means that you will not be able to tell the difference
  318.    between normal, displaying ASCII characters, and their control
  319.    and non-ASCII counterparts.  You gain a compact
  320.    representation, but you also gain ambiguity.
  321.  
  322. U  (unskip) causes the memory display pointer to decrement by one
  323.    byte.   No display is generated by this command.  This command
  324.    is useful in several contexts:
  325.  
  326.    * displaying memory in more than one format.  For example, the
  327.      specification 8b8u2g8a gives a hex-and-ASCII side-by-side
  328.      display, similar to that provided by many memory dump
  329.      programs.
  330.                                                               6-7
  331.  
  332.    * displaying memory out of its sequence order.  To test your
  333.      understanding of the special-action letters in a format
  334.      specification, you should convince yourself that the
  335.      specification xb2ujbx99/ gives the same display on the
  336.      following " continuation line as the specification w/ does.
  337.  
  338.    * displaying the count byte consumed by the @ character.  For
  339.      example, instead of @t, you could specify nu@t, which would
  340.      display the string count as well as the string.  If memory
  341.      were 05 41 42 43 44 45, this would be 5 ABCDE.
  342.  
  343. W  causes a display of a 16-bit word as a 4-digit hex number.
  344.    Numbers less than hex 1000 have one or more leading zeroes, so
  345.    that the display is always 4 digits.
  346.  
  347. X  causes the debugger to skip over the memory byte currently
  348.    pointed to, without displaying it.  The memory pointer is thus
  349.    incremented.
  350.  
  351. Z  is given immediately following another format letter.  It
  352.    causes the display to fill out the line with displays of the
  353.    given preceding format; but instead of starting with the given
  354.    address, the debugger starts with a lower address, and
  355.    displays memory up to but not including the given address.
  356.  
  357.    The most common usage of Z is to display the memory just
  358.    output by a moving output pointer.  For example, in the 8086
  359.    debugger, you could specify bz,es,di to display the hex bytes
  360.    most recently output by the STOSB instruction.
  361.  
  362.    Note that Z makes sense only in a limited number of contexts.
  363.    You will almost certainly want to use Z only as the second
  364.    letter of a two-letter specification, as in the example above.
  365.    I further recommend that you use a format letter that
  366.    generates a fixed length display; i.e., B,W,Q,O,T, or C.  If
  367.    you use a variable length display (N,D, or A), the debugger
  368.    will be as pessimistic as possible about the number of display
  369.    characters needed, so that the display will likely terminate
  370.    before the end of the line.
  371.  
  372.    A continuation of a Z-line will produce the same output as the
  373.    original line.  If you want to continue beyond the address
  374.    given, repeat the specification without the Z.
  375.  
  376.    I now discuss what happens if you use Z in other contexts.
  377.    Unless your taste runs to the bizarre, you should skip this
  378.    paragraph.  Since Z fills out a line, there should be no
  379.    specifiers after Z: they would be ignored.  Also note that Z
  380.    has an effect only on the single letter that precedes it.  If
  381.    you precede Z with more than one letter, you will get a
  382.    confusing effect: the display would start out forward from the
  383.    address, then it would retreat when it got to Z's preceding
  384.    letter.  The Z-array would run up to the address reached
  385.    before, which is forward from the address you specified.
  386.                                                               6-8
  387.  
  388. The Data Memory Window
  389.  
  390. You may cause the switchable window in the upper right quadrant
  391. of the screen to display 14 lines of memory, continuing from the
  392. last of the lines you specified within the 6-line memory area. To
  393. do this, you:
  394.  
  395. 1. Type a format-and-address specification on one of the numbered
  396.    memory lines, as previously described in this chapter.  For
  397.    example, to display Bytes at location DS:0100, type 6b,ds,0100
  398.    followed by the ENTER key.
  399.  
  400. 2. If you have already selected the memory window, you'll
  401.    automatically have a continuation of the memory line you just
  402.    specified, into the upper right quadrant of the screen.  If
  403.    not, you may select the window by pressing either the ctrl-N
  404.    or ctrl-P keys.
  405.  
  406. Once you have set up a 14-line window, you may page through
  407. memory with the ctrl-N (Next memory page) and ctrl-P (Previous
  408. memory page) keys, described in Chapter 4.
  409.  
  410. If, after having pressed ctrl-N or ctrl-P several times, you wish
  411. to return to the first window continuing from the address you
  412. specified, you may do so by typing the digit (1 to 6) of the last
  413. specification line, followed immediately by the ESC key to
  414. preserve the specification settings.  The memory window will be
  415. reset to its continuation value.  For example, if your
  416. specification was on line 6, you type 6 followed immediately by
  417. the ESC key.
  418.  
  419. If you want your 14-line memory window to start at a certain
  420. address instead of continuing from a 1-line display, you can
  421. separate the format and the address with a slash instead of a
  422. comma.  For example, if you want Words at location ES:0, type 6
  423. followed by w/es,0 followed by the ENTER key.
  424.  
  425.